cody - HTMLify profile

cody
4270 Files
632542 Views
Latest files of /cody/solygambas/html-css-javascript-projects/020-button ripple effect
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap");
* {
box-sizing: border-box;
}
body {
background-color: #000;
* {
box-sizing: border-box;
}
body {
background-color: #000;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Button Ripple Effect</title>
</head>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Button Ripple Effect</title>
</head>
const buttons = document.querySelectorAll(".ripple");
buttons.forEach((button) => {
button.addEventListener("click", function (e) {
const x = e.clientX;
const y = e.clientY;
const buttonTop = e.target.offsetTop;
const buttonLeft = e.target.offsetLeft;
buttons.forEach((button) => {
button.addEventListener("click", function (e) {
const x = e.clientX;
const y = e.clientY;
const buttonTop = e.target.offsetTop;
const buttonLeft = e.target.offsetLeft;